package org.example.service.impl;

import org.example.dao.ResumeDao;
import org.example.pojo.Resume;
import org.example.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

/**
 * @author ：xjlonly
 * @date ：Created in 2021/4/6 16:54
 * @description：
 * @modified By：
 * @version: $
 */
@Service
public class ResumeServiceImpl implements ResumeService {
    @Autowired private ResumeDao resumeDao;

    @Override
    public Resume findDefaultByUserId(Long userId) {
        Resume resume = new Resume();
        resume.setUserId(userId);
        resume.setIsDefault(1);

        Example<Resume> example = Example.of(resume);
        return  resumeDao.findOne(example).get();
    }
}
